<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PetStore UOC - Practical Case</title>
</h:head>

<ui:composition template="./headerView.xhtml">
	<ui:define name="content">
		<br/>
 
		    <h:form rendered="#{!empty customershow.dataCustomer.name}">
		 	      
		    <p><b><font face="geneva,verdana,arial" size="4">Password Edition for user:</font></b>
		    </p>
		    <table>
				
				<tr>
					<td align="right">Client NIF:</td>
					<td align="left"><input type="text" disabled="disabled"  maxlength="9" name="nifCustomer" size="10" value="#{customershow.dataCustomer.nif}"/></td>
				</tr>
				
		        <tr>
					<td align="right">Client Email:</td>
					<td align="left"><input type="text" disabled="disabled" maxlength="30" name="emailCustomer" size="31" value="#{customershow.dataCustomer.email}"/></td>
				</tr>
				
				<tr>
					<td align="right">Write current password:</td>
					<td align="left"><input type="password"  maxlength="30" name="passwordCustomer" size="31"/></td>
				</tr>
				<tr><td><p></p></td></tr>
				<tr><td><p></p></td></tr>
				
		        <tr>
					<td align="right">Write new password:</td>
					<td align="left"><input type="password"   maxlength="30" name="newPass1" size="31"/></td>
				</tr>
		        
		         <tr>
					<td align="right">Rewrite new password:</td>
					<td align="left"><input type="password"  maxlength="10" name="newPass2" size="31"/></td>
				</tr>
		    </table>
		             
		          <p align="left">
		        	<h:commandButton value="Change password" immediate="true" action="#{password.changePasswordMBean}">		
		        		<f:param name="emailCustomer" value="#{customershow.dataCustomer.email}"/>
		                <f:param name="passwordCustomer" value="passwordCustomer"></f:param>
		                <f:param name="newPass1" value="newPass1"></f:param>
		                <f:param name="newPass2" value="newPass2"></f:param>
		        	</h:commandButton>
		          </p>
		        <br/><br/><br/>
				<h:commandButton value="Back" immediate="true" action="#{password.modifyClient}" />
		                      
			</h:form>
			
			<h:form rendered="#{empty customershow.dataCustomer.name}">
		 	      
		    <p><b><font face="geneva,verdana,arial" size="4">Password Edition:</font></b>
		    </p>
		    <table>
				
				<tr>
					<td align="right">Client NIF:</td>
					<td align="left"><input type="text" disabled="disabled"  maxlength="9" name="nifCustomer" size="10" value="#{customerLogin.dataCustomer.nif}"/></td>
				</tr>
				
		        <tr>
					<td align="right">Client Email:</td>
					<td align="left"><input type="text" disabled="disabled" maxlength="30" name="emailCustomer" size="31" value="#{customerLogin.dataCustomer.email}"/></td>
				</tr>
				
				<tr>
					<td align="right">Write current password:</td>
					<td align="left"><input type="password"  maxlength="30" name="passwordCustomer" size="31"/></td>
				</tr>
				<tr><td><p></p></td></tr>
				<tr><td><p></p></td></tr>
				
		        <tr>
					<td align="right">Write new password:</td>
					<td align="left"><input type="password"   maxlength="30" name="newPass1" size="31"/></td>
				</tr>
		        
		         <tr>
					<td align="right">Rewrite new password:</td>
					<td align="left"><input type="password"  maxlength="10" name="newPass2" size="31"/></td>
				</tr>
		    </table>
		             
		          <p align="left">
		        	<h:commandButton value="Change password" immediate="true" action="#{password.changePasswordMBean}">
		        		<f:param name="emailCustomer" value="#{customerLogin.dataCustomer.email}"/>
		                <f:param name="passwordCustomer" value="passwordCustomer"></f:param>
		                <f:param name="newPass1" value="newPass1"></f:param>
		                <f:param name="newPass2" value="newPass2"></f:param>
		        	</h:commandButton>
		          </p>
		        <br/><br/><br/>
				<h:commandButton value="Back" immediate="true" action="#{password.modifyClient}" />
			</h:form>
			
	</ui:define>
</ui:composition>
</html>
